﻿<UserControl x:Class="SampleSilverlightApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:app="clr-namespace:SampleSilverlightApp"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
  <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition MaxWidth="200" />
        </Grid.ColumnDefinitions>

        <StackPanel Margin="2" app:ValidationScope.ValidationScope="{Binding ValidationScope1}">
            <ItemsControl ItemsSource="{Binding ValidationScope1.Errors}" DisplayMemberPath="ErrorContent" Foreground="Red" Margin="5"/>
            <TextBlock Text="Project Name" Margin="2,3,2,1" />
            <TextBox x:Name="txtProjectName"
			    Text="{Binding ProjectName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
                app:ValidationScope.ValidateBoundProperty="Text"
                Margin="2"/>
            <TextBlock Text="Start Date" Margin="2,3,2,1" />
            <TextBox x:Name="txtStartDate"
			    Text="{Binding StartDate, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
                app:ValidationScope.ValidateBoundProperty="Text"
                Margin="2"/>
            <TextBlock Text="End Date" Margin="2,3,2,1" />
            <TextBox x:Name="txtEndDate"
			    Text="{Binding EndDate, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
                app:ValidationScope.ValidateBoundProperty="Text"
                Margin="2"/>

            <Button x:Name="Save1Button" Content="Save" HorizontalAlignment="Right" Margin="2" Click="Save1Button_Click" />
            <!--<ItemsControl ItemsSource="{Binding ValidationScope1.Errors}" DisplayMemberPath="ErrorContent" Foreground="Red" Margin="5"/>-->
        </StackPanel>
    </Grid>
</UserControl>
